<%-- 
    Document   : Register
    Created on : Sep 9, 2012, 5:02:16 PM
    Author     : Ahsan
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="ca.trader.utils.UIUtils"%>
<%@page import="ca.trader.utils.HttpConsts"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<% if (!UIUtils.wasUserAuthenticationSuccess(session))  {%>
<%	response.sendRedirect(HttpConsts.INDEX_JSP_PAGE); }%>

<% 
    pageContext.setAttribute("CountryList", UIUtils.getCountryList());
    pageContext.setAttribute("CategoryList", UIUtils.getCategoryList());
%>

<!DOCTYPE html>
<html>
    <head>
        <jsp:include page="head.jsp" />
        <title>JSP Page</title>
    </head>
    <body>
	<div id="createSalePage">
	    <h2 style =" color: #C00">Please Fill All Fields To Sell Something</h2>
		<table>
		    <tbody>
			<tr>
			    <td id="sale_title_label">Title</td>
			    <td><input id="sale_title" type="text" name="sale_title" value =""/></td>
			</tr>
			<tr>
			    <td id="sale_desc_label">Description</td>
			    <td><textarea id="sale_desc" type="text" name="sale_desc" value ="" cols="60" rows="15"></textarea></td>
			</tr>
			<tr>
			    <td id="price_label">Price</td>
			    <td><input id="price" type="text" name="price" value =""/></td>
			</tr>
			<tr>
			    
			    <td>Sell In:</td>
			    <td> <input class="locationEnterTypeRow" id="myCityLocation" type="radio" name="locationgroup" checked value="No">My City</input></td><br/>
			    
			    
			</tr>
			<tr>
			    <td></td><td> <input class="locationEnterTypeRow" id="anotherCityLocation" type="radio" name="locationgroup" value="Yes">Another City</input></td><br/>
			</tr>
			
			<tr class="locationSetRow">			    
			    <td id="country_label">Country</td>
			    <td><select name="country" id="country_dropdown" >
				    <option></option>
				    <c:forEach var="i" items="${CountryList}">
					<option><c:out value="${i.countryName}"/></option>
				    </c:forEach>
				</select>
			    </td>
			</tr>
			<tr class="locationSetRow">
			    <td id="region_label">Region</td>
			    <td><select name="region" id="region_dropdown">
			    
				</select>
			    </td>
			</tr>
			<tr class="locationSetRow">
			    <td id="city_label">City</td>
			    <td><select name="city" id="city_dropdown">
			    
				</select>
			    </td>
			</tr>
			</div>			<tr>
			    <td id="sale_category_label">Sale Category</td>
			    <td><select name="sale_category" id="sale_category_dropdown">
				    <c:forEach var="i" items="${CategoryList}">
					<option><c:out value="${i.name}"/></option>
				    </c:forEach>
				</select>
			    </td>
			</tr>
			<tr>
			    <td></td>
			    <td><input id="create_sale_button" type="submit" value="Create sale"/></td>
			</tr>
		    </tbody>
		</table>
		<label id="errorTextLabelReg" style="color:red"></label>
		
	</div>
	
        <jsp:include page="footer.jsp" />
    </body>
</html>
